package org.lionsoul.websnail.listener;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lionsoul.websnail.Spider;
import org.lionsoul.websnail.task.Task;


public class DefaultTaskListener implements TaskListener{
    private static final Logger logger = LogManager.getLogger(DefaultTaskListener.class);
    @Override
    public void onSuccess(Spider spider, Task task) {
        logger.info("Task '{}' finished successfully.", task.getUrl());
    }

    @Override
    public void onFailed(Spider spider, Task task) {
        logger.warn("Task {} run failed.", task.getUrl());
    }
}
